Repository navigation
ci: a release whose checks fail fails the required Build, so it cannot merge - #8543
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 80 of thoseThe gate passes. Quarantined, measured but not gated (0) |
vanceingalls
left a comment
There was a problem hiding this comment.
Approved at b286350, CI green. This closes a real hole: v0.9.82 and v0.9.83 merged with a red Release checks because it isn't required.
- Gate:
Buildnowneeds: [changes, release-checks], and itsif:keeps!cancelled(), so it still runs whenRelease checksis skipped or red. The new step 2 fails only whenrelease_diff == 'true'and the release checks result isn'tsuccess(failed, cancelled or skipped all block), before any build work. - Non-release PRs:
release-checksskips at once, soBuildstarts as before. Cost on a release PR isBuildwaiting for the verify job. - Queue:
Buildalready runs in the merge queue, where the stale-notes check actually fires, so the gate is evaluated where it matters. - Test: the workflow-parse test pins the
needs, the condition and the step index, and fails against main'sci.yml.
Non-blocking: making Release checks itself required in the ruleset would be the belt-and-braces version. Keeping it in the workflow with a test is a fine call.
terencecho
left a comment
There was a problem hiding this comment.
Build is required on main. It now waits for Release checks and fails before checkout when a release diff has a non-success result. I checked both historical release queue commits. Each had a release-only diff against its first parent, which already contained the preceding queued change. This matches the classifier and the new gate. At this PR head, Build also passed with Release checks skipped on the ordinary PR path.
All 21 focused tests passed. The named regression failed against the parent workflow with “Build waits for the release checks.” The release failure path was verified by inspection of the workflow and the historical queue commits.
— tai (automated review)
jrusso1020
left a comment
There was a problem hiding this comment.
Verdict: APPROVE at b286350e. Code-owner review for .github/workflows/.
Need ✅ · Size ✅ (+26/−1) · Reuse ✅ · Simpler ✅ · Structure ✅
Risk: low. CI only. Non-release PRs skip Release checks at once, so Build starts as before.
What I checked:
- The gate fires exactly where the checks run.
release_diffis true only on a release-only diff, in a pull request or the merge queue (.github/actions/release-only-diff).release-checksruns on(merge_group && release_diff) || release_only, and on a pull requestrelease_onlyequalsrelease_diff. So the new step only failsBuildwhenRelease checksactually ran and didn't succeed, or was cancelled. It never fails on a skip that was meant to happen. Buildruns where the gate matters. In the queue a release's diff touchespackages/*/package.json, which is in thecodefilter, soBuildruns there and evaluates the step. On a release pull request,release_onlykeepsBuildrunning as before. On push and dispatch,release_diffis false, so the step is skipped.Buildkeeps!cancelled(), so the skippedrelease-checkson other PRs doesn't skipBuild. It's a required check, so a skip would have read as a pass.- Only
smoke-global-installneedsbuild, and it is unaffected. There's no cycle:release-checksneeds onlychanges. - The test parses the workflow with
yaml, which is already a root devDependency. Itsfails without the fix:line is in the body and the test. Against main'sneeds: changes, theincludes("release-checks")assertion fails. - CI at head is green, with
Buildpassing andRelease checksskipped as expected on this non-release PR.
— Rames (hf-review)
What
A release pull request whose release checks fail can no longer merge. The required
Buildcheck now waits forRelease checksand fails, before building anything, when a release's checks did not succeed.Why
Release checksrunsrelease-only-diff.mjs --verifyon a release pull request and again in the merge queue. In the queue it compares the notes against main as the queue built it. So a pull request that merged after the notes were drafted fails it: "releases/vX.md misses 1 commit(s) merged since the notes were drafted". That is the job's purpose, per its own comment.But
Release checksis not one of main's required checks, and the queue waits only for required ones. Both v0.9.82 and v0.9.83 merged while it was red:Each shipped in the packages with no line in its release's notes.
How
build(required asBuild) nowneeds: [changes, release-checks]. Its new second step fails when the diff is a release (release_diff) andRelease checksdid not succeed, whether it failed, was cancelled or was skipped.Release checksis skipped at once, soBuildstarts as before.Buildalready runs on release pull requests and in the queue (it passed in the v0.9.83 queue run whileRelease checksfailed), so the gate is always evaluated where it matters.Release checksto the branch ruleset, is a settings change. This keeps the rule in the workflow, with a test next to the check.Test plan
scripts/ci/release-only-diff.test.mjs("a release whose checks fail cannot merge: the required Build fails with them"): against main'sci.ymlit fails with "Build waits for the release checks". It parses the workflow and checks thatBuildneedsrelease-checksand that its second step fails onrelease_diff == 'true'with any result other than success.scripts/ci/release-only-diff.test.mjsandscripts/merge-queue-workflows.test.mjspass 3 runs in a row; Fallow and pre-push are clean.No visible change
CI only. A release pull request merges only once its notes list everything it ships.